Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New feature #26

Merged
merged 1 commit into from
Aug 16, 2015
Merged

New feature #26

merged 1 commit into from
Aug 16, 2015

Conversation

mingyang91
Copy link
Contributor

Hover over a row, show this object's code thumbnail

@mingyang91
Copy link
Contributor Author

preview
2015-08-07 12-32-24

@mohsen1
Copy link
Owner

mohsen1 commented Aug 7, 2015

This is very interesting. I was wondering if we can do what Chrome developer tools do and show that little preview instead of what we have for arrays and objects actually.

screen shot 2015-08-06 at 10 25 59 pm

But that's a lot more complex than simply stringifying the object and truncate the stringified string.

@mingyang91
Copy link
Contributor Author

Syntax Highlighting and Automatic retractable according to container size?

@mohsen1
Copy link
Owner

mohsen1 commented Aug 7, 2015

Yes. We do have highlighting to some point though..

@mingyang91
Copy link
Contributor Author

chrome developer tools
2015-08-07 18-47-53
me
2015-08-07 18-50-09

@mingyang91
Copy link
Contributor Author

I also felt this is good
Thumbnail information becomes more useful

My English is not good
I need the help of translation software, which may make you feel a little confused

@mohsen1
Copy link
Owner

mohsen1 commented Aug 7, 2015

I'll review this next week. Meanwhile please make this configurable and turned off by default.

Thank you!

@mingyang91
Copy link
Contributor Author

I have modified feature can be configured.
2015-08-08 09-43-03

default is turn off
2015-08-08 09-43-52

good weekend

@@ -49,7 +49,7 @@ <h1 class="text-muted">&lt;json-formatter&gt;</h1>
<p>Use <code>&lt;json-formatter&gt;</code> directive</p>
<p>
<pre>
&lt;json-formatter open="1" json="{my: 'json'}"&gt;&lt;/json-formatter&gt;
&lt;json-formatter open="1" json="{my: 'json'}" thumbnail="1"&gt;&lt;/json-formatter&gt;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use a "provider" for this configuration. This is something users will set per app.

See an example of exposing a provider here https://github.com/mohsen1/angular-json-schema-form/blob/master/src/schema-form.js#L103

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok
i want to learn ‘provider’

@mohsen1
Copy link
Owner

mohsen1 commented Aug 10, 2015

I've added a bunch of comments. Some of them are on mine own mistakes (like not using angular.isArray) but lets make the code better as we move forward! :)

The thumbnail configuration should be in app level using a config provider. I've given you an example for that. People usually use or don't use this feature per app or controller.

Don't worry about naming too much. I can do a pass and rename all of stuff at once.

Thanks!

@mingyang91
Copy link
Contributor Author

thanks for your advice.

@mingyang91
Copy link
Contributor Author

I've fixed some issues,please review.
You helped me a lot, I express my gratitude! Thanks!

@@ -57,7 +57,7 @@ <h1 class="text-muted">&lt;json-formatter&gt;</h1>
<h4>Demo</h4>
<div class="tests">
<div class="result dark">
<json-formatter json="complex" open="1" class="json-formatter-dark"></json-formatter>
<json-formatter json="complex" open="1" class="json-formatter-dark" thumbnail="1"></json-formatter>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be here anymore.

@mingyang91
Copy link
Contributor Author

Thank you !
I have fixed.

@mohsen1
Copy link
Owner

mohsen1 commented Aug 15, 2015

Could you please rebase into one commit?

Hover over a row, show this object's code thumbnail

remove unreferenced attribute

compile new dist

more useful Thumbnail information
like Chrome Developer Tools

Remove json key double quotes

configurable of thumbnail
default is turned off

update demo.html

thumbnail -> provider

config provider

enable thumbnail in demo

Simplify test case

deal with other issues

demo.html
     thumbnail default is disabled
 json-formatter.js
     parseInt add radix value
     setEnabled -> .enabled (use setter)
mohsen1 added a commit that referenced this pull request Aug 16, 2015
@mohsen1 mohsen1 merged commit 147d49d into mohsen1:master Aug 16, 2015
mohsen1 added a commit that referenced this pull request Aug 21, 2015
New build adds result of #26 to dist
Export address issue #27 and pull request #29
@mohsen1
Copy link
Owner

mohsen1 commented Aug 21, 2015

@mingyang91
Copy link
Contributor Author

( ゜- ゜)つロ cheers~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants